import {url} from '../utils'
import {Customer} from '@/store/modules/types/Customer'

const state = {}

const mutations = {}

const actions = {
  list(context: any, opt: any) {
    return axios.post(url('/api/customer/list'), opt)
  },
  create(context:any, customer: Customer) {
    return axios.post(url('/api/customer/create'), customer)
  },
  update(context:any, customer: Customer) {
    return axios.post(url(`/api/customer/update/${customer.id}`), customer)
  },
}

const getters = {}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters
}
